#include <inttypes.h>#include <avr/io.h>#include <avr/pgmspace.h>#include "lcd.h"
Go to the source code of this file.
Defines | |
| #define | DDR(x) (*(&x - 1)) |
| #define | PIN(x) (*(&x - 2)) |
| #define | lcd_e_delay() __asm__ __volatile__( "rjmp 1f\n 1:" ); |
| #define | lcd_e_high() LCD_E_PORT |= _BV(LCD_E_PIN); |
| #define | lcd_e_low() LCD_E_PORT &= ~_BV(LCD_E_PIN); |
| #define | lcd_e_toggle() toggle_e() |
| #define | lcd_rw_high() LCD_RW_PORT |= _BV(LCD_RW_PIN) |
| #define | lcd_rw_low() LCD_RW_PORT &= ~_BV(LCD_RW_PIN) |
| #define | lcd_rs_high() LCD_RS_PORT |= _BV(LCD_RS_PIN) |
| #define | lcd_rs_low() LCD_RS_PORT &= ~_BV(LCD_RS_PIN) |
| #define | LCD_FUNCTION_DEFAULT LCD_FUNCTION_4BIT_2LINES |
| #define | delay(us) _delayFourCycles( ( ( 1*(XTAL/4000) )*us)/1000 ) |
Functions | |
| static void | toggle_e (void) |
| static void | _delayFourCycles (unsigned int __count) |
| static void | lcd_write (uint8_t data, uint8_t rs) |
| static uint8_t | lcd_read (uint8_t rs) |
| static uint8_t | lcd_waitbusy (void) |
| static void | lcd_newline (uint8_t pos) |
| void | lcd_command (uint8_t cmd) |
| Send LCD controller instruction command. | |
| void | lcd_data (uint8_t data) |
| Send data byte to LCD controller. | |
| void | lcd_gotoxy (uint8_t x, uint8_t y) |
| Set cursor to specified position. | |
| int | lcd_getxy (void) |
| void | lcd_clrscr (void) |
| Clear display and set cursor to home position. | |
| void | lcd_home (void) |
| Set cursor to home position. | |
| void | lcd_putc (char c) |
| Display character at current cursor position. | |
| void | lcd_puts (const char *s) |
| Display string without auto linefeed. | |
| void | lcd_puts_p (const char *progmem_s) |
| Display string from program memory without auto linefeed. | |
| void | lcd_init (uint8_t dispAttr) |
| Initialize display and select type of cursor. | |
| #define DDR | ( | x | ) | (*(&x - 1)) |
| #define delay | ( | us | ) | _delayFourCycles( ( ( 1*(XTAL/4000) )*us)/1000 ) |
| #define lcd_e_delay | ( | ) | __asm__ __volatile__( "rjmp 1f\n 1:" ); |
| #define lcd_e_high | ( | ) | LCD_E_PORT |= _BV(LCD_E_PIN); |
| #define lcd_e_low | ( | ) | LCD_E_PORT &= ~_BV(LCD_E_PIN); |
| #define lcd_e_toggle | ( | ) | toggle_e() |
| #define LCD_FUNCTION_DEFAULT LCD_FUNCTION_4BIT_2LINES |
| #define lcd_rs_high | ( | ) | LCD_RS_PORT |= _BV(LCD_RS_PIN) |
| #define lcd_rs_low | ( | ) | LCD_RS_PORT &= ~_BV(LCD_RS_PIN) |
| #define lcd_rw_high | ( | ) | LCD_RW_PORT |= _BV(LCD_RW_PIN) |
| #define lcd_rw_low | ( | ) | LCD_RW_PORT &= ~_BV(LCD_RW_PIN) |
| #define PIN | ( | x | ) | (*(&x - 2)) |
| static void _delayFourCycles | ( | unsigned int | __count | ) | [inline, static] |
| int lcd_getxy | ( | void | ) |
| static void lcd_newline | ( | uint8_t | pos | ) | [inline, static] |
Definition at line 306 of file lcd.c.
References lcd_command(), LCD_DDRAM, LCD_START_LINE1, LCD_START_LINE2, LCD_START_LINE3, and LCD_START_LINE4.
Referenced by lcd_putc().
| static uint8_t lcd_read | ( | uint8_t | rs | ) | [static] |
Definition at line 216 of file lcd.c.
References data, DDR, LCD_DATA0_PIN, LCD_DATA0_PORT, LCD_DATA1_PIN, LCD_DATA1_PORT, LCD_DATA2_PIN, LCD_DATA2_PORT, LCD_DATA3_PIN, LCD_DATA3_PORT, lcd_e_delay, lcd_e_high, lcd_e_low, lcd_rs_high, lcd_rs_low, lcd_rw_high, and PIN.
Referenced by lcd_waitbusy().
| static uint8_t lcd_waitbusy | ( | void | ) | [static] |
Definition at line 285 of file lcd.c.
References delay, LCD_BUSY, and lcd_read().
Referenced by lcd_command(), lcd_data(), lcd_getxy(), and lcd_putc().
| static void lcd_write | ( | uint8_t | data, | |
| uint8_t | rs | |||
| ) | [static] |
Definition at line 135 of file lcd.c.
References DDR, LCD_DATA0_PIN, LCD_DATA0_PORT, LCD_DATA1_PIN, LCD_DATA1_PORT, LCD_DATA2_PIN, LCD_DATA2_PORT, LCD_DATA3_PIN, LCD_DATA3_PORT, lcd_e_toggle, lcd_rs_high, lcd_rs_low, and lcd_rw_low.
Referenced by lcd_command(), lcd_data(), lcd_init(), and lcd_putc().
| static void toggle_e | ( | void | ) | [static] |
1.5.3